package DAY007;

import java.util.Scanner;

public class Guessing {
    public static void main(String[] args) {
        Scanner san = new Scanner(System.in);
        int nam = (int) (Math.random()*1000+1);
        while (true){
            System.out.println("猜吧");
            int guess = san.nextInt();
            if (guess<nam){
                System.out.println("猜小了");
            }else if (guess>nam){
                System.out.println("猜大了");
            }else {
                System.out.println("恭喜你猜到了");
                break;
            }

        }
    }


}

//        Scanner san = new Scanner(System.in);
//        int nam = (int) (Math.random()*1000+1);
//        while (true){
//            System.out.println("猜吧");
//            int guess = san.nextInt();
//            if (guess<nam){
//                System.out.println("猜小了");
//            }else if (guess>nam){
//                System.out.println("猜大了");
//            }else {
//                System.out.println("恭喜你猜到了");
//                break;
//            }
//
//        }
//    }
//
//
//}
